{% extends "hwam/base.html" %}

{% block sub-title %}Organizational Unit - {{ ou }} | {% endblock %}

{% block content-main %}

<h1>{{ ou }} (Organizational Unit)</h1>
<a href="{% url 'hwam:ou_update' ou.id %}">Edit</a>
&middot;
<a href="{% url 'hwam:ou_delete' ou.id %}">Delete</a>
&middot;
<a href="{% url 'hwam:ou_index' %}">Index</a>

<p>{{ ou.desc }}</p>
<ul>
    <li>Contact: {{ ou.unit_contact.username }}
        <a href="mailto:{{ ou.unit_contact.email }}">
            {{ ou.unit_contact.email }}</a>
    </li>
    {% if ou.parent_ou %}
        <li>Parent OU:
            <a href="{% url 'hwam:ou_detail' ou.parent_ou.id %}">
                {{ ou.parent_ou }}</a></li>
    {% endif %}
    {% if ou.child_ous.all %}
        <li>Child OUs:<ul>
        {% for u in ou.children %}
            <li><a href="{% url 'hwam:ou_detail' u.id %}">
                {{ u }}</a></li>
        {% endfor %}
        </ul></li>
    {% endif %}
    <li>Hardware Assets:<ul>
        {% for a in ou.hardware_assets.all %}
            <li><a href="{% url 'hwam:hw_detail' a.id %}">
                    {{ a }}</a></li>
        {% endfor %}
        </ul></li>
    <li>Software Assets:<ul>
        {% for a in ou.software_assets.all %}
            <li><a href="{% url 'hwam:sw_detail' a.id %}">
                    {{ a }}</a></li>
        {% endfor %}
        </ul></li>
</ul>

{% endblock %}
